<?php
/**
 * Created by PhpStorm.
 * User: edmmss
 * Date: 2018/12/28
 * Time: 21:02
 */

namespace app\models;


use yii\db\ActiveRecord;

class EntityObject
{
    private $_entity;

    /**
     * EntityObject constructor.
     * @param $entity
     */
    public function __construct($entity)
    {
        $this->_entity = $entity;
    }

    /**
     * 判断是否是实体
     *
     * @date   2018/12/29
     * @author edmmss
     * @return bool
     */
    public function isEntity()
    {
        return $this->_entity instanceof ActiveRecord;
    }

    /**
     * 获取实体
     *
     * @date   2018/12/29
     * @author edmmss
     * @return mixed
     */
    public function getEntity()
    {
        return $this->_entity;
    }
}